extends RichTextLabel


# Declare member variables here. Examples:
# var a = 2
# var b = "text"
var index=0
export var Infos:PoolStringArray
var sprite
# Called when the node enters the scene tree for the first time.
func _ready():
	text=Infos[0]
	print(Infos.size())
	sprite=get_parent().get_node("Sprite")
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass

func change_data():
	if index==0:
		sprite.texture=load("res://Images/npc1.png")
	if index==2:
		sprite.texture=load("res://Images/people2.png")
		pass
func _on_R_pressed():
	if index<Infos.size()-1:
		index+=1
		text=Infos[index]
		print(index)
		change_data()
	pass # Replace with function body.


func _on_L_pressed():
	if index>0:
		index-=1
		text=Infos[index]
		print(index)
		change_data()
	pass # Replace with function body.


func _on_back_pressed():
	get_tree().change_scene("res://Scenes/Main.tscn")
	pass # Replace with function body.
